package com.cib.xagcjs.web;

import com.cib.xagcjs.biz.EcnyLockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Description: 数币冻结通知接口
 * Author: jingcaiqi1225@gmail.com
 * Date: 2024/2/22 14:19
 */
@Controller
@RequestMapping(value = "/epay")
public class EcnyLockController {

    @Autowired
    private EcnyLockService ecnyLockService;

    /**
     * 区块链发起 数币冻结通知
     * @param req 请求
     * @return 执行结果
     */
    @PostMapping("/lock")
    @ResponseBody
    public String encyLock (@RequestBody String req) {
        return ecnyLockService.encyLock(req);
    }

    /**
     * 行方发起 数币冻结结果通知
     * @param req 请求
     * @return 执行结果
     */
    @PostMapping("/lockNotify")
    @ResponseBody
    public String lockNotify (@RequestBody String req) {
        return ecnyLockService.lockNotify(req);
    }
}
